﻿using System.ComponentModel.DataAnnotations;
using EPiServer.Personalization.VisitorGroups;
using EPiServer.Web.Mvc.VisitorGroups;

namespace CriteriaPack.TimeOnSiteCriterion
{
    public class TimeOnSiteModel : CriterionModelBase
    {
        [Required, DojoWidget(DefaultValue = 0, AdditionalOptions = "{ constraints: {min: 0}, selectOnClick: true }"), Range(0, 60)]
        public int TimeOnSite { get; set; }

        [Required, DojoWidget(SelectionFactoryType = typeof(EnumSelectionFactory))]
        public DurationUnit DurationUnit { get; set; }

        public override ICriterionModel Copy()
        {
            return base.ShallowCopy();
        }
    }
}